import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import WindiCSS from 'vite-plugin-windicss'

import path from "path"

// https://vitejs.dev/config/
export default defineConfig({
  __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
  resolve:{
    alias:{
      "~":path.resolve(__dirname,"src")
    }
  },
  // 配置devServer
  Server: {
    host: '0.0.0.0', // 项目运行的ip
    port: 8888, // 项目运行的端口号
  },

  server:{
    proxy:{
      '/api': {
        // target: 'http://ceshi13.dishait.cn',
        target: 'http://192.168.31.150:9090',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
    },
    port: 8888,
    host:'0.0.0.0'
  },
  // __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'true',
  plugins: [vue(),WindiCSS()]
})
